package zyd.springboot.springbootmybatis.service.ex;

/**
 * 自定义异常可以继承两种异常类 Exception(编译时异常) 或 RuntimeException(运行时异常)
 * 默认情况下，RuntimeException及其子类可以触发Spring事务管理的回滚操作，而
 * Exception及其非RuntimeException的子类不行
 *
 * 业务层所有异常的父类
 */
public class ServiceException extends RuntimeException{

    public ServiceException() {
    }

    public ServiceException(String message) {
        super(message);
    }

    public ServiceException(String message, Throwable cause) {
        super(message, cause);
    }

    public ServiceException(Throwable cause) {
        super(cause);
    }

    public ServiceException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }
}
